import { ConfigProvider, message } from 'antd';
import zhCN from 'antd/lib/locale/zh_CN';
import 'antd/dist/antd.css';
import './index.less';

import Login from './login';
import Main from './main';

// sessionStorage.setItem('isLogin', '1');
export default function (props: any) {
    const isLogin = sessionStorage.getItem('isLogin');
    return (
        <ConfigProvider locale={zhCN}>
            {
                isLogin ? <Main location={props.location} children={props.children} /> : <Login location={props.location} children={props.children}/>
            }        
        </ConfigProvider>
    );
}